<template>
  <div id="app">
    <router-view />
  </div>
</template>
<script setup>
import { onBeforeMount } from 'vue'
import { useStore } from 'vuex'
import { useRouter } from 'vue-router'
import { getToken } from '@ruifox-cms/utils/src/storage'

const store = useStore()
const router = useRouter()
onBeforeMount(async () => {
  if (getToken() && !router.currentRoute.value.meta.whiteList) {
    await  store.dispatch('user/login')
    const { iconInit } = await import('@ruifox-cms/utils')
    const res = await store.dispatch('base/getGroupSetting')
    iconInit(res.publicIcon)
  }
})
</script>

<style lang="scss">
#app{
  width: 100vw;
  height: 100vh;
  overflow-y: hidden;
}
</style>